			
var xmlRequest = createXHQ();

xmlRequest.open("GET","../json/categoryRacks.json");
xmlRequest.send();

xmlRequest.onreadystatechange=function(){
	
	if(xmlRequest.readyState===4){
		if(xmlRequest.status===200){
			var result1 = xmlRequest.responseText;
			var resultObject = JSON.parse(result1);	
			
			var f_div = document.getElementById("shop-main");
			
			
			
			for(var i=0;i<resultObject.length;i++){
				
				var z_div = document.createElement("div");
				z_div.className = "shops";
				
				var z_main="<em>"+resultObject[i].shop_id+"</em>"+
							"<img src="+resultObject[i].img_big+" />"+
							"<div class='shop1-s'>"+
								"<img src="+resultObject[i].img_small[0]+" />"+
								"<img src="+resultObject[i].img_small[1]+" />"+
								"<img src="+resultObject[i].img_small[2]+" />"+
							"</div>"+
							"<span class='monay'>￥"+ resultObject[i].shop_money +"</span>"+
							"<span class='shop-t'>"+ resultObject[i].shop_title +"</span>";
				z_div.innerHTML=z_main;
				
				f_div.appendChild(z_div);
				
			}
		}else{
			alert("错误信息："+xmlRequest.status);
		}
	}
}

window.onload=function(){



	var s1 = document.getElementsByClassName("shops");
	for(var i=0;i<s1.length;i++){
		s1[i].onmouseover=function(){
			this.id='seover1';
		}
	}
	
	for(var i=0;i<s1.length;i++){
		s1[i].onclick=function(){
			var id = this.getElementsByTagName("em")[0].innerHTML;
			window.location.href="informationShopp.html?shoppingID="+id;
		}
	}
	
	for(var i=0;i<s1.length;i++){
		s1[i].onmouseout=function(){
			this.id='seover2';
		}
	}
	
}